import React, { Component } from 'react'
import { Upload, Icon} from 'antd'

class MyUpload extends Component{
  constructor(props){
    super(props);      
  };
  render(){
    const uploadButton = (
      <div>
        <Icon type='plus' />
        <div className="ant-upload-text">点击上传</div>
      </div>
    );
    return (
      <Upload name="file" listType="picture-card" showUploadList={false} className="avatar-uploader"
        action="/common/uploadFile"
        onChange={this.props.handleChange}
      >
      {this.props.logoUrl ? <img src={this.props.logoUrl} style={{ width: '100%' }} /> : uploadButton}
      </Upload>
    )
  }
}
export default MyUpload
